diff -Naur svnsrc/main/java/org/jboss/ws/common/CommonContextServlet.java src/main/java/org/jboss/ws/common/CommonContextServlet.java
--- svnsrc/main/java/org/jboss/ws/common/CommonContextServlet.java	2006-11-23 12:46:06.020148158 +0100
+++ src/main/java/org/jboss/ws/common/CommonContextServlet.java	2006-11-22 23:24:45.197304705 +0100
@@ -25,6 +25,7 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.net.URL;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -67,7 +68,7 @@
       setupHTMLResponseHeader(writer);
 
       writer.print("<body>");
-      writer.print(epManager.showServiceEndpointTable());
+      writer.print(epManager.showServiceEndpointTable(new URL(req.getRequestURL().toString())));
       writer.print("</body>");
       writer.print("</html>");
       writer.close();
diff -Naur svnsrc/main/java/org/jboss/ws/server/ServiceEndpoint.java src/main/java/org/jboss/ws/server/ServiceEndpoint.java
--- svnsrc/main/java/org/jboss/ws/server/ServiceEndpoint.java	2006-11-23 12:46:16.360840292 +0100
+++ src/main/java/org/jboss/ws/server/ServiceEndpoint.java	2006-11-22 23:23:40.077284902 +0100
@@ -127,7 +127,8 @@
       ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
       EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
 
-      String wsdlHost = reqURL.getHost();
+      String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() + ":" + reqURL.getPort();
+      
       
       ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
       ServiceEndpointManager epManager = factory.getServiceEndpointManager();
diff -Naur svnsrc/main/java/org/jboss/ws/server/ServiceEndpointManager.java src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
--- svnsrc/main/java/org/jboss/ws/server/ServiceEndpointManager.java	2006-11-23 12:46:16.404843237 +0100
+++ src/main/java/org/jboss/ws/server/ServiceEndpointManager.java	2006-11-22 23:44:54.361128301 +0100
@@ -273,7 +273,7 @@
 
    /** Show the registered webservices
     */
-   public String showServiceEndpointTable()
+   public String showServiceEndpointTable(URL requestURL) throws java.net.MalformedURLException
    {
       StringWriter sw = new StringWriter();
       PrintWriter pw = new PrintWriter(sw);
@@ -290,7 +290,14 @@
          ServiceEndpoint wsEndpoint = (ServiceEndpoint)entry.getValue();
          ServiceEndpointInfo seInfo = wsEndpoint.getServiceEndpointInfo();
          String endpointAddress = seInfo.getServerEndpointMetaData().getEndpointAddress();
-         pw.println("<tr><td>" + sepID.getCanonicalName() + "</td><td><a href='" + endpointAddress + "?wsdl'>" + endpointAddress + "?wsdl</a></td></tr>");
+         URL displayURL = new URL(endpointAddress);
+         String endPointPath = displayURL.getPath();
+         if (this.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == true)
+         {
+        	 displayURL = requestURL;
+         }
+         String displayAddress = displayURL.getProtocol() + "://" + displayURL.getHost() + ":" + displayURL.getPort() + endPointPath;
+         pw.println("<tr><td>" + sepID.getCanonicalName() + "</td><td><a href='" + displayAddress + "?wsdl'>" + displayAddress + "?wsdl</a></td></tr>");
       }
       pw.println("</table>");
       pw.close();
diff -Naur svnsrc/main/java/org/jboss/ws/server/WSDLRequestHandler.java src/main/java/org/jboss/ws/server/WSDLRequestHandler.java
--- svnsrc/main/java/org/jboss/ws/server/WSDLRequestHandler.java	2006-11-23 12:46:16.376841363 +0100
+++ src/main/java/org/jboss/ws/server/WSDLRequestHandler.java	2006-11-22 23:23:40.113287111 +0100
@@ -130,13 +130,17 @@
 
                      if (resPath != null && resPath.indexOf("/") > 0)
                         newResourcePath = resPath.substring(0, resPath.lastIndexOf("/") + 1) + orgLocation;
-
-                     String reqProtocol = reqURL.getProtocol();
-                     int reqPort = reqURL.getPort();
-                     String hostAndPort = wsdlHost + (reqPort > 0 ? ":" + reqPort : "");
+                     String completeHost = wsdlHost;
                      String reqPath = reqURL.getPath();
-                     
-                     String newLocation = reqProtocol + "://" + hostAndPort + reqPath + "?wsdl&resource=" + newResourcePath;
+                     if (! wsdlHost.startsWith("http://") && wsdlHost.startsWith("https://")) 
+                     {
+	                     String reqProtocol = reqURL.getProtocol();
+	                     int reqPort = reqURL.getPort();
+	                     String hostAndPort = wsdlHost + (reqPort > 0 ? ":" + reqPort : "");
+	                     	                     
+	                     completeHost = reqProtocol + "://" + hostAndPort;
+                     } 
+                     String newLocation = completeHost + reqPath + "?wsdl&resource=" + newResourcePath;
                      locationAttr.setNodeValue(newLocation);
 
                      log.debug("Mapping import from '" + orgLocation + "' to '" + newLocation + "'");
@@ -155,10 +159,15 @@
                   String locPath = locURL.getPath();
                   if (reqURL.getProtocol().equals(locProtocol) && reqURL.getPath().equals(locPath))
                   {
-                     int locPort = locURL.getPort();
-                     String hostAndPort = wsdlHost + (locPort > 0 ? ":" + locPort : "");
-                     
-                     String newLocation = locProtocol + "://" + hostAndPort + locPath;
+                	 String completeHost = wsdlHost;
+                	 if (! wsdlHost.startsWith("http://") && wsdlHost.startsWith("https://")) 
+                     {
+	                	 int locPort = locURL.getPort();
+	                     String hostAndPort = wsdlHost + (locPort > 0 ? ":" + locPort : "");
+	                     
+	                     completeHost = locProtocol + "://" + hostAndPort;
+                     }
+                	 String newLocation = completeHost  + locPath;
                      locationAttr.setNodeValue(newLocation);
 
                      log.debug("Mapping address from '" + orgLocation + "' to '" + newLocation + "'");
diff -Naur svnsrc/main/resources/jbossws.beans/META-INF/jboss-beans.xml src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
--- svnsrc/main/resources/jbossws.beans/META-INF/jboss-beans.xml	2006-11-23 12:46:29.317707513 +0100
+++ src/main/resources/jbossws.beans/META-INF/jboss-beans.xml	2006-11-23 14:18:25.603767914 +0100
@@ -12,9 +12,9 @@
         If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'alwaysModifySOAPAddress' is true.
         If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
         
-        If 'webServiceHost' is an empty string, JBossWS uses requesters host when rewriting the <soap:address>.
+        If next line is commented, JBossWS uses requesters protocolo, host and port when rewriting the <soap:address>.
       -->
-      <property name="webServiceHost">${jboss.bind.address}</property>
+      <property name="webServiceHost">${jboss.bind.address}</property> 
       
       <!-- If these two properties are not set the ports will be identified by querying the -->
       <!-- list of installed connectors, if multiple connectors are found the port of the   -->
